package cn.regexp.job.feign;

import cn.regexp.common.core.domain.SeckillProductVo;
import cn.regexp.common.core.web.Result;
import cn.regexp.job.feign.fallback.SeckillProductFeignFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author Regexpei
 * @date 2024/7/5 22:51
 * @description 秒杀商品远程调用
 */
@Component
@FeignClient(name = "lego-shop-service-seckill", fallback = SeckillProductFeignFallback.class)
public interface SeckillProductFeignApi {
    /**
     * 查询秒杀商品数据
     *
     * @param time 场次
     * @return 秒杀商品数据
     */
    @PostMapping("/seckillProduct/selectByType")
    Result<List<SeckillProductVo>> selectByType(@RequestParam("time") int time);
}
